import Vue from 'vue'
import Router from 'vue-router'
import user from '@/User/login/login'
import vote from '@/User/vote/vote'
import preson from '@/User/preson/preson'
// import intro from '@/User/vote/introduction/introduction'
import login from '@/Pages/login/login'
import home from '@/Pages/home/home'
import notice from '@/Pages/notice/notice'
import admin from '@/Pages/admin/admin'
import add from '@/Pages/add/add'

Vue.use(Router)

const Client = new Router({
  routes:
    [{
      path: '/',
      name: 'user',
      component: user
    }, {
      path: '/vote',
      name: 'vote',
      component: vote
    }, {
      path: '/vote/:id',
      name: 'preson',
      component: preson
  // }, {
  //   path: '/vote2',
  //   name: 'intro',
  //   components: intro
  //
    }],

  scrollBehavior (to, from, savedPosition) {
    return {x: 0, y: 0}
  }
})
const Administrator = new Router({
  routes:
  [{
    path: '/',
    name: 'login',
    component: login
  }, {
    path: '/home',
    name: 'home',
    component: home
  }, {
    path: '/home/notice',
    name: 'notice',
    component: notice
  }, {
    path: '/home/add',
    name: 'add',
    component: add
  }, {
    path: '/home/admin',
    name: 'admin',
    component: admin
  }],

  scrollBehavior (to, from, savedPosition) {
    return {x: 0, y: 0}
  }
})
export default
    Client
   // Administrator
